<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>首页</title>

		<link href="AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link href="basic/css/demo.css" rel="stylesheet" type="text/css" />

		<link href="css/hmstyle.css" rel="stylesheet" type="text/css" />
		<script src="AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
		<script src="AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>
		<script src="basic/js/axios.min.js"></script>
		<script src="basic/js/vue.js"></script>
	</head>

	<body>
		<div class="hmtop" id="indexTop">
			<!--顶部导航条 -->
			<div class="am-container header">
				<ul class="message-l">
					<div class="topMessage">
						<div class="menu-hd">
							<span v-if="nickname != null">
								Hi!&nbsp;&nbsp;{{nickname}}&nbsp;&nbsp;
								<a href="/" @click="logout" target="_top">退出</a>
							</span>
							<span v-else>
							<a href="login.html" target="_top" class="h">亲，请登录</a>&nbsp;&nbsp;
							<a href="register.html" target="_top">免费注册</a>
							</span>
						</div>
					</div>
				</ul>
				<ul class="message-r">
					<div class="topMessage home">
						<div class="menu-hd"><a href="/" target="_top" class="h">商城首页</a></div>
					</div>
					<div class="topMessage my-shangcheng">
						<div class="menu-hd MyShangcheng"><a href="person/information.html" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
					</div>
					<div class="topMessage mini-cart">
						<div class="menu-hd"><a id="mc-menu-hd" href="home/shopcart.html" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
					</div>
					<div class="topMessage favorite">
						<div class="menu-hd"><a href="#" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
				</ul>
				</div>

				<!--悬浮搜索框-->

				<div class="nav white">
					<div class="logo"><img src="images/logo.png" /></div>
					<div class="logoBig">
						<li><img src="images/logobig.png" /></li>
					</div>

					<div class="search-bar pr">
						<a name="index_none_header_sysc" href="#"></a>
						<form style="border: 2px solid black">
							<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off" style="padding-left: 10px;font-size: 1.3em">
							<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit" style="background-color: black">
						</form>
					</div>
				</div>

				<div class="clear"></div>
			</div>

		<script>
			Vue.createApp({
				setup(){
					const username = Vue.ref()
					const nickname = Vue.ref()
					Vue.onMounted(()=>{
						if (localStorage.getItem("token")!==null){
							username.value = localStorage.getItem("username")
							nickname.value = localStorage.getItem("nickname")
						}
					})
					const logout = () => {
					  localStorage.clear()
					}
					return{
						username,
						nickname,
						logout,
					}
				}
			}).mount("#indexTop")
		</script>

			<div class="banner" style="border-top: 2px solid black ">
                      <!--轮播 -->
						<div class="am-slider am-slider-default scoll" data-am-flexslider id="demo-slider-0">
							<ul class="am-slides">
								<li class="banner1" style="background-color: black"><a href="home/introduction.html"><img src="images/ad1.jpg" /></a></li>
								<li class="banner2" style="background-color: black"><a><img src="images/ad2.jpg" /></a></li>
								<li class="banner3" style="background-color: black"><a><img src="images/ad3.jpg" /></a></li>
								<li class="banner4" style="background-color: black"><a><img src="images/ad4.jpg" /></a></li>

							</ul>
						</div>
						<div class="clear"></div>
			</div>

			<div class="shopNav" id="publishMaster">
				<div class="slideall">

					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="/">首页</a></li>
                                <li class="qc" v-if="token != null">
									<a href="home/goods.html">所有商品</a>
								</li>
								<li class="qc" v-else>
									<a href="login.html">所有商品</a>
								</li>
                                <li class="qc last" v-if="username != null">
									<a href="home/joinUs.html">加入我们</a>
								</li>
								<li class="qc last" v-else>
									<a href="login.html">加入我们</a>
								</li>
								<li class="qc" style="float: right" v-if="nickname==null">
									<a href="register.html">注册</a>
								</li>
								<li class="qc last" style="float: right" v-if="nickname==null">
									<a href="login.html">登录</a>
								</li>
								<li class="qc" style="float: right;border: 2px solid black" v-else>
									<a href="javascript:void(0)">欢迎登陆！ {{nickname}}</a>
								</li>
							</ul>
						</div>

						<!--侧边导航 -->
						<div id="nav" class="navfull">
							<div class="area clearfix">
								<div class="category-content" id="guide_2">

									<div class="category">
										<ul class="category-list" id="js_climit_li">
											<li class="appliance js_toggle relative first" v-for="i in typesData" @click="btnType(i.id)">
												<div class="category-info">
													<h3 class="category-name b-category-name">
														<span>
															<a class="ml-22">{{i.name}}</a>
														</span>
													</h3>
												</div>
											<b class="arrow"></b>
											</li>
										</ul>
									</div>
								</div>

							</div>
						</div>
						<!--轮播 -->
						<script type="text/javascript">
							(function() {
								$('.am-slider').flexslider();
							});
							$(document).ready(function() {
								$("li").hover(function() {
									$(".category-content .category-list li.first .menu-in").css("display", "none");
									$(".category-content .category-list li.first").removeClass("hover");
									$(this).addClass("hover");
									$(this).children("div.menu-in").css("display", "block")
								}, function() {
									$(this).removeClass("hover")
									$(this).children("div.menu-in").css("display", "none")
								});
							})
						</script>


					<!--小导航 -->
					<div class="am-g am-g-fixed smallnav">
						<div class="am-u-sm-3">
							<a href="home/goods.html"><img src="images/navsmall.jpg" />
								<div class="title">所有商品</div>
							</a>
						</div>
						<div class="am-u-sm-3">
							<a href="home/joinUs.html"><img src="images/logosmall2.jpg" />
								<div class="title">加入我们</div>
							</a>
						</div>
						<div class="am-u-sm-3" v-if="username!=null">
							<a href="person/information.html"><img src="images/mansmall.jpg" />
								<div class="title">个人中心</div>
							</a>
						</div>
						<div class="am-u-sm-3" v-else>
							<a href="login.html"><img src="images/mansmall.jpg" />
								<div class="title">个人中心</div>
							</a>
						</div>
						<div class="am-u-sm-3">
							<a href="home/aboutUs.html"><img src="images/logosmall.jpg" />
								<div class="title">关于我们</div>
							</a>
						</div>
					</div>

					<div class="clear"></div>
				</div>
				<script type="text/javascript">
					if ($(window).width() < 640) {
						function autoScroll(obj) {
							$(obj).find("ul").animate({
								marginTop: "-39px"
							}, 500, function() {
								$(this).css({
									marginTop: "0px"
								}).find("li:first").appendTo(this);
							})
						}
						$(function() {
							setInterval('autoScroll(".demo")', 3000);
						})
					}
				</script>
			</div>

		<script>
			Vue.createApp({
				setup(){
					const username = Vue.ref();
					const nickname = Vue.ref();
					const typesData = Vue.ref();
					const btnType = (type_id) => {
						if (localStorage.getItem("token")==null){
							location.href='login.html'
						}else {
					  		localStorage.setItem("typeId",type_id)
							location.href='home/goods.html'
						}

					}
					const getTypes = () => {
						axios({
							url: 'http://localhost:8080/goods/type',
							method: 'post',
						}).then(res=>{
							if (res.data.success){
								console.log(res.data.data)
								typesData.value = res.data.data
								console.log(typesData.value)
							}else {
								alert("类别查询失败")
							}
						}).catch(e=>{
							alert("网络出差")
						})
					}
					Vue.onMounted(()=>{
						if (localStorage.getItem("token")!==null){
							username.value = localStorage.getItem("username")
							nickname.value = localStorage.getItem("nickname")
						}
						getTypes()
					})
					return{
						token: localStorage.getItem("token"),
						username,
						nickname,
						btnType,
						typesData,
						getTypes,
					}
				}
			}).mount("#publishMaster")
		</script>
			</div>
		</div>
		</div>
		<!--引导 -->

		<div class="navCir">
			<li class="active"><a href="index.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="home/sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="home/shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>
			<li><a href="person/index.html"><i class="am-icon-user"></i>我的</a></li>
		</div>
		<!--菜单 -->
		<div class=tip>
			<div id="sidebar">
				<div id="wrap">
					<div id="prof" class="item ">
						<a href="# ">
							<span class="setting "></span>
						</a>
						<div class="ibar_login_box status_login ">
							<div class="avatar_box ">
								<p class="avatar_imgbox "><img src="images/no-img_mid_.jpg " /></p>
								<ul class="user_info ">
									<li>用户名：sl1903</li>
									<li>级&nbsp;别：普通会员</li>
								</ul>
							</div>
							<div class="login_btnbox ">
								<a href="# " class="login_order ">我的订单</a>
								<a href="# " class="login_favorite ">我的收藏</a>
							</div>
							<i class="icon_arrow_white "></i>
						</div>

					</div>
					<div id="shopCart " class="item ">
						<a href="home/shopcart.html ">
							<span class="message "></span>
						</a>
						<p>
							购物车
						</p>
						<p class="cart_num ">0</p>
					</div>
					<div id="asset " class="item ">
						<a href="# ">
							<span class="view "></span>
						</a>
						<div class="mp_tooltip ">
							我的资产
							<i class="icon_arrow_right_black "></i>
						</div>
					</div>

					<div id="foot " class="item ">
						<a href="# ">
							<span class="zuji "></span>
						</a>
						<div class="mp_tooltip ">
							我的足迹
							<i class="icon_arrow_right_black "></i>
						</div>
					</div>

					<div id="brand " class="item ">
						<a href="#">
							<span class="wdsc "><img src="images/wdsc.png " /></span>
						</a>
						<div class="mp_tooltip ">
							我的收藏
							<i class="icon_arrow_right_black "></i>
						</div>
					</div>

					<div id="broadcast " class="item ">
						<a href="# ">
							<span class="chongzhi "><img src="images/chongzhi.png " /></span>
						</a>
						<div class="mp_tooltip ">
							我要充值
							<i class="icon_arrow_right_black "></i>
						</div>
					</div>

					<div class="quick_toggle ">
						<li class="qtitem ">
							<a href="# "><span class="kfzx "></span></a>
							<div class="mp_tooltip ">客服中心<i class="icon_arrow_right_black "></i></div>
						</li>
						<!--二维码 -->
						<li class="qtitem ">
							<a href="#none "><span class="mpbtn_qrcode "></span></a>
							<div class="mp_qrcode " style="display:none; "><img src="images/weixin_code_145.png " /><i class="icon_arrow_white "></i></div>
						</li>
						<li class="qtitem ">
							<a href="#top " class="return_top "><span class="top "></span></a>
						</li>
					</div>

					<!--回到顶部 -->
					<div id="quick_links_pop " class="quick_links_pop hide "></div>

				</div>

			</div>
			<div id="prof-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					我
				</div>
			</div>
			<div id="shopCart-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					购物车
				</div>
			</div>
			<div id="asset-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					资产
				</div>

				<div class="ia-head-list ">
					<a href="# " target="_blank " class="pl ">
						<div class="num ">0</div>
						<div class="text ">优惠券</div>
					</a>
					<a href="# " target="_blank " class="pl ">
						<div class="num ">0</div>
						<div class="text ">红包</div>
					</a>
					<a href="# " target="_blank " class="pl money ">
						<div class="num ">￥0</div>
						<div class="text ">余额</div>
					</a>
				</div>

			</div>
			<div id="foot-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					足迹
				</div>
			</div>
			<div id="brand-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					收藏
				</div>
			</div>
			<div id="broadcast-content " class="nav-content ">
				<div class="nav-con-close ">
					<i class="am-icon-angle-right am-icon-fw "></i>
				</div>
				<div>
					充值
				</div>
			</div>
		</div>
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery.min.js "><\/script>');
		</script>
		<script type="text/javascript " src="basic/js/quick_links.js "></script>
	</body>

</html>
